package com.czh.api.impl;

import com.czh.entity.User;
import com.czh.api.UserService;

import java.util.Random;
import java.util.UUID;

/**
 * @author chenzhihua
 * @desc TODO
 * @date 2024/1/5
 * @Version V1.1.0
 */
public class UserServiceImpl implements UserService {
    @Override
    public User getUserById(Integer id) {
        System.out.println("客户端查询了"+id+"的用户");
        // 模拟从数据库中取用户的行为
        Random random = new Random();
        User user = User.builder().userName(UUID.randomUUID().toString())
                .id(id)
                .sex(random.nextBoolean()).build();
        return user;
    }

    @Override
    public int insertUser(User user) {
        System.out.println("客户端插入了"+user+"的用户");
        return 0;
    }
}
